Since a flash memory is inexpensive, and is low in power consumption and has a small size, the flash memory is widely used as a storage device in various embedded systems.
In particular, a NAND flash memory which is one of types of the widely used flash memories is constituted by a plurality of erase blocks and each erase block is constituted by a plurality of pages. In the case of a large block NAND flash memory which has been increasingly used in recent years, the size of one page is 2 KB and 64 pages are gathered to constitute one erase block.
The flash memory is capable of performing three operations of Read, Write, and Erase. Read/Write is performed by the page and Write is called a program. In order to program a page which has been programmed once again, the entirety of an erase block to which the page belongs needs to be first erased and the Erase operation requires more time than Read/Write operations. Since each erase block is limited in the number of erasable times, when the number of erase times reaches a limit, the corresponding erase block cannot be used. An erase block which cannot be used any longer corresponds to a bad block. Therefore, a sufficient life-span of the flash memory can be ensured only when wear leveling that enables the respective erase blocks to be evenly used is achieved.
As such, the flash memory has a problem in which it takes a long time to rewrite data in a region in which data has been written once again and a problem in which when the block of the flash memory is gradually abraded with repeated usage to reach a limit, the block cannot be used. Accordingly, a scheme is presented, which solves such problems by processing data by performing a specific operation in a file system corresponding to an upper layer of the flash memory.
A representative file system used in the flash memory is a log-structured file system. The log-structured file system stores data in a scheme that sequentially writes both metadata and data of a file system in a log by regarding a storage space as one log.
The log-structured file system includes a sprite LFS in which the log-structured file system (LFS) is implemented in a sprite operating system, a flash-friendly file system (F2FS) in which a structure of the sprite LFS is improved to be suitable for being used for a flash translation layer (FTL) based flash storage device, a new implementation of a log-structured file system (NILFS2) that provides a snapshot function, and the like.